import { appFetch } from "@/utils/tools";


export const getWebsiteTypePaginationApi = (body: any) => appFetch(
  '/api/websiteTypes/getWebsiteTypesPagination',
  {
    method: 'post',
    body: JSON.stringify(body)
  }
)

export const getAllWebsiteTypesByConditionApi = (body?: any) => appFetch(
  '/api/websiteTypes/getAllWebsiteTypesByCondition',
  {
    method: 'post',
    body: JSON.stringify(body),
  }
)

export const addWebsiteTypeApi = (body: {
  name: string,
  description: string
}) => appFetch(
  '/api/websiteTypes/addWebsiteType',
  {
    method: 'post',
    body: JSON.stringify(body)
  }
)

export const updateWebsiteTypeApi = (_id: string, body: {
  name: string,
  description: string
}) => appFetch(
  `/api/websiteTypes/updateWebsiteType/${_id}`,
  {
    method: 'put',
    body: JSON.stringify(body)
  }
)

export const deleteWebsiteTypeApi = (ids: string[]) => appFetch(
  `/api/websiteTypes/deleteWebsiteTypes`,
  {
    method: 'delete',
    body: JSON.stringify({
      ids
    })
  }
)